/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf.views;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dchapman
 */
@Entity
@Table(name = "Hops")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "HopInventoryView.findAll", query = "SELECT h FROM HopInventoryView h ORDER BY h.hopName ASC")})
public class HopInventoryView implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "HID")
    private Integer hid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 80)
    @Column(name = "HopName")
    private String hopName;
    @Basic(optional = false)
    @NotNull
    @Column(name = "HopOnHand")
    private float hopOnHand;
    @Basic(optional = false)
    @NotNull
    @Column(name = "HopSpoken")
    private float hopSpoken;
    @Basic(optional = false)
    @NotNull
    @Column(name = "HopOnOrder")
    private float hopOnOrder;

    public HopInventoryView() {
    }

    public HopInventoryView(Integer hid) {
        this.hid = hid;
    }

    public HopInventoryView(Integer hid, String hopName, float hopOnHand, float hopSpoken, float hopOnOrder) {
        this.hid = hid;
        this.hopName = hopName;
        this.hopOnHand = hopOnHand;
        this.hopSpoken = hopSpoken;
        this.hopOnOrder = hopOnOrder;
    }

    public Integer getHid() {
        return hid;
    }

    public void setHid(Integer hid) {
        this.hid = hid;
    }

    public String getHopName() {
        return hopName;
    }

    public void setHopName(String hopName) {
        this.hopName = hopName;
    }

    public float getHopOnHand() {
        return hopOnHand;
    }

    public void setHopOnHand(float hopOnHand) {
        this.hopOnHand = hopOnHand;
    }

    public float getHopSpoken() {
        return hopSpoken;
    }

    public void setHopSpoken(float hopSpoken) {
        this.hopSpoken = hopSpoken;
    }

    public float getHopOnOrder() {
        return hopOnOrder;
    }

    public void setHopOnOrder(float hopOnOrder) {
        this.hopOnOrder = hopOnOrder;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hid != null ? hid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HopInventoryView)) {
            return false;
        }
        HopInventoryView other = (HopInventoryView) object;
        if ((this.hid == null && other.hid != null) || (this.hid != null && !this.hid.equals(other.hid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.HopInventoryView[ hid=" + hid + " ]";
    }
}
